<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/5/22
  Time: 17:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <title>申请详情</title>
    <script type="application/javascript">
           function returnMain() {
               window.location.href="${pageContext.request.contextPath}/XzTempletBaseInfo/choiceBaseTemplet.emp";
           }

           function approvalFallback(templetBaseInfoId,approvalprocessInfoId,roleName) {
               if (confirm("确定要从审批角色为\""+roleName+"\"处开始回退吗？")) {
                  window.location.href="${pageContext.request.contextPath}/XzTempletBaseInfo/approvalFallback.emp?templetBaseInfoId="+templetBaseInfoId+"&approvalprocessInfoId="+approvalprocessInfoId;
               }
           }
           
    </script>
</head>
<body>
<form>
    <!--头部开始-->
    <jsp:include page="headerBack.jsp"/>
    <!-- 导航 -->
    <jsp:include page="leftBack.jsp"/>

    <div class="main">
        <!--内容页头部-->
        <div class="page-header">
            <div class="pull-left">
                <ol class="breadcrumb visible-sm visible-md visible-lg">
                    <li><a href="index.html"><i class="icon fa fa-home"></i>主页</a></li>
                    <li class="active"><i class="fa fa-pencil"></i>模板</li>
                </ol>
            </div>
            <div class="pull-right">
                <h2>主页</h2>
            </div>
        </div>
        <div class="mould">
    <div style="margin: 0 auto;text-align: center"><h2>${templetBaseInfo.templetName}</h2></div>
            <hr/>
    <div style="text-align: center">
   <!--基础模板表中的信息-->
<div>
      <div style="width: 60%;margin: 0 auto;text-align: left">
       <strong>申请人：</strong>

          ${templetBaseInfo.emp.empName}
      </div>

    <div style="padding-top: 10px;text-align: left;width: 60%;margin: 0 auto;">
      <strong>申请时间：</strong>

            <fmt:formatDate value="${templetBaseInfo.applicantTime}" type="both"/>
        </div>

</div>
        <!--扩展模板表中的信息-->
        <%--<div style="margin: 0 auto;margin-top: 10px;float: left;width: 60%;border:1px solid red;">--%>

    <c:forEach var="extend" items="${templetBaseInfo.extendInfoObjectList}"  varStatus="status">
         <%--<strong>原由：</strong>--%>
        <div style="text-align: left;width: 60%;margin: 0 auto;margin-top: 10px">
        <strong>${extend.templetExtend.extendType}</strong>：${extend.extendValue}
        </div>
    </c:forEach>

        <!--表格-->
        <div class="well" style="width: 60%;margin: 0 auto;margin-top: 100px">

                <table class="table" id="now">
                    <thead>
                    <tr>
                        <th class="d">审批的角色</th>
                         <th class="d">审批状态</th>
                        <th class="d">回退</th>
                    </tr>
                    </thead>

                    <tbody>


                    <c:forEach var="approvalProcess" items="${templetBaseInfo.approvalProcessInfoObjectList}">
                        <tr>
                            <td>
                             ${approvalProcess.role.roleName}
                            </td>
                             <td>
                                 <c:if test="${approvalProcess.auditStatus == 0}">审核中</c:if>
                                 <c:if test="${approvalProcess.auditStatus == 1}">成功</c:if>
                                 <c:if test="${approvalProcess.auditStatus == 2}">驳回</c:if>
                                 <c:if test="${approvalProcess.auditStatus == 3}">撤回</c:if>
                             </td>
                            <td><a onclick="approvalFallback(${templetBaseInfo.templetBaseInfoId},${approvalProcess.approvalprocessInfoId},'${approvalProcess.role.roleName}')"><li class="fa fa-mail-reply"></li></a></td>


                        </tr>
                    </c:forEach>


                    </tbody>
                </table>

        </div>
    </div>
            <div style="text-align: center;margin-top: 50px"><button type="button" onclick="returnMain()" class="btn btn-primary">返回</button></div>
    </div>
    </div>
</form>
</body>
</html>
